<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>05事件</title>
  <script src="js/vue(1).js"></script>
</head>
<body>
<div id="div">
  <input type="text" v-model="msg" v-on:blur="f(msg,$event)">
  <div @click="f('abc',$event)">这是div元素</div>
  <input type="button" value="获取dom元素" @click="fetch();">
  <div ref="div2">新的div元素</div>
  <div/>
  <script>
    var vm = new vue({
      el:"#div",
      data:{
        msg:"hello"
      },
      methods:{
        f(msg,event){
          console.log(msg);
          //event.target 拿到的是HTML的标签
          //console.log(event.target.innerHTML);
          console.log(event.target.innerHTML);//非表单元素
        },
        fetch(){
          console.log(this.$refs.div2.innerText);
        }
      }
    })
  </script>
</body>
</html>